﻿<%@ Page Title="Business Partner List" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="CustomerProfile.aspx.cs" Inherits="VSM.CustomerProfile" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2>&nbsp;<asp:Label ID="lblTitle" runat="server" Text="Business Partner List"></asp:Label>
                </h2>
    <asp:HiddenField ID="hdnisUpdate" runat="server" />
    <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div style="margin-left: 5px; width: 99%;">
                <hr />
                <table border="0" width="100%" style="background-color: #D1D4D8; font-weight: bold;">
                    <tr>
                        <td style="width: 50px">Group:
                        </td>
                        <td style="width: 120px">
                            <asp:DropDownList ID="ddlGroup" runat="server" AutoPostBack="True" 
                                onselectedindexchanged="ddlGroup_SelectedIndexChanged" >
                                <asp:ListItem Value="103">Customer</asp:ListItem>
                                <asp:ListItem Value="104">Dealer</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td style="width: 100px">Dealers:</td>
                        <td >
                            <asp:DropDownList ID="ddlDealer" runat="server" AutoPostBack="True" 
                                onselectedindexchanged="ddlDealer_SelectedIndexChanged" >
                            </asp:DropDownList>
                        </td>
                    </tr>
                </table>
                <hr />
                <table style="width: 100%;" border="0">
                    <tr>
                        <td style="width: 35%">
                            <asp:Button ID="btnNewBP" runat="server" Text="New Business Partner" Style="background-image: url('/Images/bgButton.png');
                                background-repeat: no-repeat;" OnClick="btnNewBP_Click" />
                        </td>
                        <td style="width: 65%">
                            <asp:Label ID="lblError" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:GridView ID="grvItem" CssClass="GridInner" runat="server" Width="100%" BorderColor="White"
                                BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                                HeaderStyle-Height="27px" CellSpacing="2" OnRowEditing="EditItem"
                                HeaderStyle-VerticalAlign="Middle" OnRowCancelingEdit="CancelEdit" OnRowDeleting="DeleteItem"
                                OnRowDataBound="grvSearchResult_RowDataBound"   AllowPaging="True" OnPageIndexChanging="grvSearchResult_PageIndexChanging" PageSize="20">
                                <PagerSettings Mode="NumericFirstLast" />
                                <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                                <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px" />
                                <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Action">
                                        <ItemStyle HorizontalAlign="Center"  Width="3%"/>
                                        <HeaderStyle VerticalAlign="Middle" />
                                        <ItemTemplate>
<%--                                            <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" OnClick="lnkDelete_Click" OnClientClick='return confirm("Are you sure to delete?");'></asp:LinkButton> | --%>
                                            <asp:LinkButton ID="lnkEdit" runat="server" Text='Edit' BorderStyle="none" OnClick="lnkEdit_Click">
                                            </asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Customer Code">
                                        <ItemStyle HorizontalAlign="Center" Width="7%" />
                                        <HeaderStyle VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblCardCode" runat="server" Text='<%# Bind("CardCode") %>' BorderStyle="none"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Customer Name">
                                        <ItemStyle HorizontalAlign="left" Width="30%" />
                                        <HeaderStyle VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:Label ID="txtCardName" runat="server" Text='<%# Bind("CardName") %>' BorderStyle="none" />
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Address">
                                        <ItemStyle HorizontalAlign="left" />
                                        <HeaderStyle VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:Label ID="txtAddress" runat="server" Text='<%# Bind("Address") %>' BorderStyle="none" />
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="E-mail">
                                        <ItemStyle HorizontalAlign="left" Width="15%" />
                                        <HeaderStyle VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:Label ID="txtE_Mail" runat="server" Text='<%# Bind("E_Mail") %>' BorderStyle="none" />
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Created Date">
                                        <ItemStyle HorizontalAlign="Center" Width="6%" />
                                        <HeaderStyle VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblCreateDate" runat="server" Text='<%# Bind("CreateDate") %>' BorderStyle="none" />
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Updated Date">
                                        <ItemStyle HorizontalAlign="Center" Width="6%" />
                                        <HeaderStyle VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblUpdateDate" runat="server" Text='<%# Bind("UpdateDate") %>' BorderStyle="none" />
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Customer Type">
                                        <ItemStyle HorizontalAlign="Center" Width="5%" />
                                        <HeaderStyle VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:Label ID="txtCustomerType" runat="server" Text='<%# Bind("CardType") %>' BorderStyle="none" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False" Height="27px" VerticalAlign="Bottom" />
                                <EmptyDataTemplate>
                                    <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all"
                                        cellspacing="2" cellpadding="2">
                                        <tr valign="middle" style="height: 27px; color: white; font-weight: bold; text-decoration: none; background-color: rgb(96, 149, 201);">
                                            <th style="width: 10%">
                                                <span>Action</span>
                                            </th>
                                            <th style="width: 10%">
                                                <span>Customer Code</span>
                                            </th>
                                            <th style="width: 25%">
                                                <span>Customer Name</span>
                                            </th>
                                            <th style="width: 30%">
                                                <span>Address</span>
                                            </th>
                                            <th style="width: 20%">
                                                <span>E-mail</span>
                                            </th>

                                            <th style="width: 5%">
                                                <span>Customer Type</span>
                                            </th>

                                        </tr>
                                        <tr>
                                            <td colspan="6">
                                                <span>No Data</span>
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
                <br />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
